<?php 
namespace app\model;

use think\Model;
use think\Db;

class Courier extends Model{
	public static function getListByPage($num){
		$res = Db::name('courier co')
				->field("co.courier_id,	courier_name, courier_phone, status,co.gmt_create, count(o.order_id) as num")
				->join("order o","co.courier_id = o.courier_id and o.is_done=0","left")
				->group('co.courier_id')
				->paginate($num);
		return $res;
	}
	
}

?>